import { request } from '@/service/request';

/** 获取游戏排行榜列表 */
export function fetchGetGameLeaderboardList (params?: Api.Games.GameLeaderboardSearchParams) {
    return request<Api.Games.GameLeaderboardList>({
        url: '/games/gameLeaderboard/list',
        method: 'get',
        params
    });
}

/** 新增游戏排行榜 */
export function fetchCreateGameLeaderboard (data: Api.Games.GameLeaderboardOperateParams) {
    return request<boolean>({
        url: '/games/gameLeaderboard',
        method: 'post',
        data
    });
}

/** 修改游戏排行榜 */
export function fetchUpdateGameLeaderboard (data: Api.Games.GameLeaderboardOperateParams) {
    return request<boolean>({
        url: '/games/gameLeaderboard',
        method: 'put',
        data
    });
}

/** 批量删除游戏排行榜 */
export function fetchBatchDeleteGameLeaderboard (rankIds: CommonType.IdType[]) {
    return request<boolean>({
        url: `/games/gameLeaderboard/${rankIds.join(',')}`,
        method: 'delete'
    });
}
